<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>网站配置</title>
    <link rel="shortcut icon" href="favicon.ico">
    <link href="__CSS__/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="__CSS__/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="__CSS__/animate.min.css" rel="stylesheet">
    <link href="__CSS__/style.min.css?v=4.1.0" rel="stylesheet">
    <link href="__CSS__/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="__JS__/plugins/bootstrap-tagsinput/bootstrap-tagsinput.css" rel="stylesheet">
    <link href="__JS__/layui/css/layui.css"rel="stylesheet">
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>网站配置</h5>
                </div>
                <div class="ibox-content">
                    <form class="form-horizontal m-t" id="commentForm" method="post" action="{:url('config/index')}">
                        <input type="hidden" name="id" value="{$config_info.id}">
                        <div class="form-group">
                            <label class="col-sm-3 control-label">服务电话：</label>
                            <div class="input-group col-sm-7">
                                <input id="title" type="text" class="form-control" name="tile" required="" value="{$config_info.tile}" aria-required="true">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">订单过期时间：</label>
                            <div class="input-group col-sm-7">
                                <input id="exp_time" type="text" class="form-control" name="exp_time" placeholder="按分钟计算" required="" value="{$config_info.exp_time}" aria-required="true">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">师傅取消订单说明：</label>
                            <div class="input-group col-sm-7">
                                <input id="sf_quxiao" class="form-control" name="sf_quxiao" value="{$config_info['sf_quxiao']}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">师傅取转让订单说明：</label>
                            <div class="input-group col-sm-7">
                                <input id="zhuanrang_quxiao" class="form-control" name="zhuanrang_quxiao" value="{$config_info['zhuanrang_quxiao']}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">用户取消订单说明：</label>
                            <div class="input-group col-sm-7">
                                <input id="yh_quxiao" class="form-control" name="yh_quxiao" value="{$config_info['yh_quxiao']}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">用户更换师傅说明：</label>
                            <div class="input-group col-sm-7">
                                <input id="genhuan_remake" class="form-control" name="genhuan_remake" value="{$config_info['genhuan_remake']}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">最低提现金额：</label>
                            <div class="input-group col-sm-7">
                                <input id="money" type="text" class="form-control" name="money" required="" value="{$config_info.money}" aria-required="true">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">师傅0元保证金：</label>
                            <div class="input-group col-sm-7">
                                <!--<input id="a_bail" type="text" class="form-control" name="a_bail"style="margin: 1rem 0"  required=""placeholder="初级保证金数量" value="{$config_info.a_bail}" aria-required="true">-->
                                <input id="baozj_time" type="text" class="form-control" name="baozj_time"style="margin: 1rem 0"  required=""placeholder="时间需要换算成秒" value="{$config_info.baozj_time}" aria-required="true">
                                <input id="baozj_0_count" type="text" class="form-control" name="baozj_0_count"style="margin: 1rem 0"  required=""placeholder="限制接单数量" value="{$config_info.baozj_0_count}" aria-required="true">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">师傅初级保证金：</label>
                            <div class="input-group col-sm-7">
                                <input id="a_bail" type="text" class="form-control" name="a_bail"style="margin: 1rem 0"  required=""placeholder="初级保证金数量" value="{$config_info.a_bail}" aria-required="true">
                                <input id="atime" type="text" class="form-control" name="atime"style="margin: 1rem 0"  required=""placeholder="时间需要换算成秒" value="{$config_info.atime}" aria-required="true">
                                <input id="acount" type="text" class="form-control" name="acount"style="margin: 1rem 0"  required=""placeholder="限制接单数量" value="{$config_info.acount}" aria-required="true">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label">师傅中级保证金：</label>
                            <div class="input-group col-sm-7">
                                <input id="a_bail_two" type="text" class="form-control"style="margin: 1rem 0"  name="a_bail_two" placeholder="中级保证金数量" required="" value="{$config_info.a_bail_two}" aria-required="true">
                                <input id="atime_two" type="text" class="form-control"style="margin: 1rem 0"  name="atime_two" required="" placeholder="时间需要换算成秒" value="{$config_info.atime_two}" aria-required="true">
                                <input id="acount_two" type="text" class="form-control"style="margin: 1rem 0"  name="acount_two" required="" placeholder="限制接单数量" value="{$config_info.acount_two}" aria-required="true">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">师傅高级保证金：</label>
                            <div class="input-group col-sm-7">
                                <input id="a_bail_three" type="text" class="form-control" style="margin: 1rem 0" name="a_bail_three" placeholder="高级保证金数量" required="" value="{$config_info.a_bail_three}" aria-required="true">
                                <input id="atime_three" type="text" class="form-control"style="margin: 1rem 0"  name="atime_three" required="" placeholder="时间需要换算成秒" value="{$config_info.atime_three}" aria-required="true">
                                <input id="acount_three" type="text" class="form-control"style="margin: 1rem 0"  name="acount_three" required="" placeholder="限制接单数量" value="{$config_info.acount_three}" aria-required="true">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">服务商延迟接单时间：</label>
                            <div class="input-group col-sm-7">
                                <input id="b_bail" type="text" class="form-control" name="b_bail" style="margin: 1rem 0"   required="" placeholder="服务商保证金" value="{$config_info.b_bail}" aria-required="true">
                                <input id="btiame" type="text" class="form-control" name="btiame"  style="margin: 1rem 0"  required="" placeholder="时间需要换算成秒" value="{$config_info.btiame}" aria-required="true">
                                <input id="bcount" type="text" class="form-control" name="bcount" style="margin: 1rem 0"   required="" placeholder="服务商限制接单数" value="{$config_info.bcount}" aria-required="true">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">产品描述：</label>
                            <div class="input-group col-sm-7">
                                <textarea id="description" class="form-control" name="remke" required=""  aria-required="true">{$config_info.remke}</textarea>
                            </div>
                        </div>
                        <div class="form-group">
                        <label class="col-sm-3 control-label">保证金说明：</label>
                        <div class="input-group col-sm-7">
                            <script id="remark" name="remark" type="text/plain">
                                    {$config_info.remark}
                                </script>
                            <!--<textarea id="remark" class="form-control"rows="10"  name="remark" required=""  aria-required="true">{$config_info.remark}</textarea>-->
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">余额说明：</label>
                            <div class="input-group col-sm-7">
                                <script id="tixian_content" name="tixian_content" type="text/plain">
                                    {$config_info.tixian_content}
                                </script>
                                <!--<textarea id="remark" class="form-control"rows="10"  name="remark" required=""  aria-required="true">{$config_info.remark}</textarea>-->
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">转让次数限制：</label>
                            <div class="input-group col-sm-7">
                                <input id="yongjin" type="munber" class="form-control" name="zhuanrang" required="" placeholder="0-100"  value="{$config_info.zhuanrang}" aria-required="true">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">推荐提成次数：</label>
                            <div class="input-group col-sm-7">
                                <input id="tuijian" type="text" class="form-control" name="tuijian" required="" placeholder=""  value="{$config_info.tuijian}" aria-required="true">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">推荐提成百分比：</label>
                            <div class="input-group col-sm-7">
                                <input id="tuijian_ticheng" type="text" class="form-control" name="tuijian_ticheng" required="" placeholder=""  value="{$config_info.tuijian_ticheng}" aria-required="true">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">分享说明：</label>
                            <div class="input-group col-sm-7">
                                <textarea id="share_remark" class="form-control" rows="5" name="share_remark" required=""  aria-required="true">{$config_info.share_remark}</textarea>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">首页优惠券展示图：</label>
                            <input name="url" id="thumbnail" type="hidden"/>
                            <div class="form-inline">
                                <div class="input-group col-sm-2">
                                    <button type="button" class="layui-btn" id="test1">
                                        <i class="layui-icon">&#xe67c;</i>上传图片
                                    </button>
                                </div>
                                <div class="input-group col-sm-3">
                                    <div id="sm"></div>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">首页优惠券展示图是否显示：</label>
                            <div class="input-group col-sm-6">
                                <div class="radio i-checks col-sm-4">
                                    <label>
                                        <input type="radio" value="1" name="is_show" {if condition="$config_info.is_show == 1 " }checked{/if} > <i></i> 显示</label>
                                </div>
                                <div class="radio i-checks col-sm-4">
                                    <label>
                                        <input type="radio" value="0" name="is_show" {if condition="$config_info.is_show == 0 " }checked{/if} > <i></i> 不显示</label>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">用户协议：</label>
                            <div class="input-group col-sm-7">
                                <!--<textarea id="yonghu_xieyi" class="form-control" name="yonghu_xieyi" rows="15" required=""  aria-required="true">{$config_info.yonghu_xieyi}</textarea>-->
                                <script id="yonghu_xieyi" name="yonghu_xieyi" type="text/plain">
                                    {$config_info.yonghu_xieyi}
                                </script>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">入住协议：</label>
                            <div class="input-group col-sm-7">
                                <script id="container" name="content" type="text/plain">
                                    {$config_info.content}
                                </script>
                            </div>
                        </div>

                        <div class="form-group">
                            <div class="col-sm-4 col-sm-offset-8">
                                <!--<input type="button" value="提交" class="btn btn-primary" id="postform"/>-->
                                <button class="btn btn-primary" type="submit">确认提交</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>

        </div>
    </div>
</div>
<script src="__JS__/jquery.min.js?v=2.1.4"></script>
<script src="__JS__/bootstrap.min.js?v=3.3.6"></script>
<script src="__JS__/content.min.js?v=1.0.0"></script>
<script src="__JS__/plugins/bootstrap-tagsinput/bootstrap-tagsinput.min.js"></script>
<script src="__JS__/plugins/validate/jquery.validate.min.js"></script>
<script src="__JS__/plugins/validate/messages_zh.min.js"></script>
<script src="__JS__/plugins/iCheck/icheck.min.js"></script>
<script src="__JS__/layui/layui.js"></script>
<script src="__JS__/jquery.form.js"></script>
<script src="__JS__/plugins/ueditor/ueditor.config.js"></script>
<script src="__JS__/plugins/ueditor/ueditor.all.js"></script>
<script type="text/javascript">

    var index = '';
    function showStart(){
        index = layer.load(0, {shade: false});
        return true;
    }

    function showSuccess(res){

        layer.ready(function(){
            layer.close(index);
            if(1 == res.code){
                layer.alert(res.msg, {title: '友情提示', icon: 1, closeBtn: 0}, function(){
                    window.location.href = res.data;
                });
            }else if(111 == res.code){
                window.location.reload();
            }else{
                layer.msg(res.msg, {anim: 6});
            }
        });
    }

    $(document).ready(function(){
        $(".i-checks").iCheck({checkboxClass:"icheckbox_square-green",radioClass:"iradio_square-green",});
        // 添加角色
        var options = {
            beforeSubmit:showStart,
            success:showSuccess
        };

        $('#commentForm').submit(function(){
            $(this).ajaxSubmit(options);
            return false;
        });

        $('#sf_quxiao').tagsinput('add', 'some tag');
        $('#yh_quxiao').tagsinput('add', 'some tag');
        $('#genhuan_remake').tagsinput('add', 'some tag');
        $('#zhuanrang_quxiao').tagsinput('add', 'some tag');
        $(".bootstrap-tagsinput").addClass('col-sm-12').find('input').addClass('form-control')
            .attr('placeholder', '输入后按enter');

        // 上传图片
        layui.use('upload', function(){
            var upload = layui.upload;

            //执行实例
            var uploadInst = upload.render({
                elem: '#test1' //绑定元素
                ,url: "{:url('articles/uploadImg')}" //上传接口
                ,done: function(res){
                    //上传完毕回调
                    $("#thumbnail").val(res.data.src);
                    $("#sm").html('<img src="' + res.data.src + '" style="width:40px;height: 40px;"/>');
                }
                ,error: function(){
                    //请求异常回调
                }
            });
        });

        var editor = UE.getEditor('container');
        var editor = UE.getEditor('remark');
        var editor = UE.getEditor('yonghu_xieyi');
        var editor = UE.getEditor('tixian_content');
    });

    // 表单验证
    $.validator.setDefaults({
        highlight: function(e) {
            $(e).closest(".form-group").removeClass("has-success").addClass("has-error")
        },
        success: function(e) {
            e.closest(".form-group").removeClass("has-error").addClass("has-success")
        },
        errorElement: "span",
        errorPlacement: function(e, r) {
            e.appendTo(r.is(":radio") || r.is(":checkbox") ? r.parent().parent().parent() : r.parent())
        },
        errorClass: "help-block m-b-none",
        validClass: "help-block m-b-none"
    });
</script>
</body>
</html>
